/**
 * This file is part of the Agora distribution. 
 * Detailed copyright and licensing information can be found
 * in the gpl-3.0.txt file which should be included in the distribution.
 * 
 * @version		$Id: 3.0.14 Olympus 2010-09-28 rammstein4o $
 * @copyright  2007 - 2010 jVitals
 * @license   GPLv3 Open Source
 * @link       http://jvitals.com
 * @since      File available since initial release
 */
function gMapProfile(lng,lat,zoom,marker)
{
	var map = new GMap(document.getElementById("map"));
//	map.addControl(new GSmallMapControl());
	map.addControl(new GLargeMapControl());
	map.addControl(new GMapTypeControl());
	map.centerAndZoom(new GPoint(lng, lat), zoom);
	if (marker) {
		map.addOverlay(new GMarker(new GPoint(lng, lat)));
	}

	GEvent.addListener(map, 'click', function(overlay, point) {
		if (overlay) {
			map.removeOverlay(overlay);
			document.getElementById("lat").value='';
			document.getElementById("lng").value='';
		} else if (point) {
			map.clearOverlays();
	    	map.addOverlay(new GMarker(point));
			document.getElementById("lat").value=point.y;
		document.getElementById("lng").value=point.x;
		}
	});
}

function gMapProfilePreview(lng,lat,zoom)
{
	var map = new GMap(document.getElementById("map"));
	map.addControl(new GSmallMapControl());
	map.addControl(new GMapTypeControl());
	map.centerAndZoom(new GPoint(lng, lat), zoom);
	map.addOverlay(new GMarker(new GPoint(lng, lat)));
}
